import Vue from 'vue'
import Vuex from 'vuex'
//脑电接口store

Vue.use(Vuex)

const store = new Vuex.Store({

	state() {
		return {
			blueToothSever:null,
			blueToothDeviceId:'',
			blueToothDataGlobal:[],//蓝牙
			status:'',
			//蓝牙数据计数器
			num:0,	
            shake: false
		}
	},

	mutations: {
		//计数
		SET_NUM(state,value){
			state.num = state.num +1
			//每秒都传来一次值
		},
		SET_STATUS(state,value){
			state.status = value
		},
		SPLICE_BLUETOOTHDATAGLOBAL(state,value){
			return	state.blueToothDataGlobal.splice(0,800)
		},
		SET_BLUETOOTHDATAGLOBAL(state,value){
			state.blueToothDataGlobal.push(value)
			console.log('更新全局蓝牙数据')
		},
		SET_BLUETOOTHDATAGLOBALLONGENOUGH(state,value){
			state.blueToothDataGlobal=value
			console.log('更新全局蓝牙数据满800')
		},
		SET_BLUETOOTHSEVER(state,value){
			console.log('调用')
			state.blueToothSever = value
		},
		SET_BLUETOOTHDEVICEID(state,value){
			state.blueToothDeviceId = value
		}
	},
	actions: {
		
	},

})

export default store
